<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta charset="utf-8" />
    <title>后台管理-经销商编辑</title>

    <meta name="keywords" content="{$Think.CONFIG.keywords}" />
    <meta name="description" content="{$Think.CONFIG.description}" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

    <include file="Public/head" />
</head>
<?php $Dealer='active';$ptitle='经销商管理';$title='修改';?>
<body class="no-skin">
<include file="Public/header" />
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try{ace.settings.check('main-container' , 'fixed')}catch(e){}
    </script>

    <include file="Public/sidebar" />
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Public/breadcrumbs" />

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Public/set" />

                <!-- /section:settings.box -->
                <div class="row">
                    <div class="col-xs-12">
                        <form action="{:U('dealer_edit')}" method="post" class="ajax-form">
                            <input type="hidden" name="uid" value="{$info['dealer_id']}">
                            <input type="hidden" name="p" value="{$p}">
                            <input type="hidden" name="search_content" value="{$search_content}">
                            <div class="form-horizontal">
                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right" for="dealer_name"> 经销商名称 <span class="required">*</span> </label>
                                    <div class="col-sm-9">
                                        <input type="text" name='dealer_name' class="rcol-xs-10 col-sm-5" value="{$info['dealer_name']}" id="dealer_name" placeholder="经销商名称">
                                    </div>
                                </div>
                                <div class="space-4"></div>
                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right" for="dealer_name"> ，店铺名称 <span class="required">*</span> </label>
                                    <div class="col-sm-9">
                                        <input type="text" name='store_name' value="{$info['store_name']}" class="rcol-xs-10 col-sm-5" placeholder="门店名称">
                                    </div>
                                </div>
                                <div class="space-4"></div>

                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right"> 店铺图片 </label>
                                    <div class="col-sm-9">
                                        <div class="col-xs-10 col-sm-5"><input type="file" class="multi_img" name="store_picture">
                                            <img name='pic' id="pic" src="__ROOT__{$info['store_picture']}" style="width:120px;padding-top:10px;">
                                        </div>
                                    </div>
                                </div>
                                <div class="space-4"></div>

                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right" for="dealer_name"> ，店铺面积 <span class="required">*</span> </label>
                                    <div class="col-sm-9">
                                        <input type="text" name='store_area' value="{$info['store_area']}" class="rcol-xs-10 col-sm-5" placeholder="店铺面积">
                                    </div>
                                </div>
                                <div class="space-4"></div>

                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right"> 微信二维码 </label>
                                    <div class="col-sm-9">
                                        <div class="col-xs-10 col-sm-5"><input type="file" class="multi_img" name="QR_code">
                                            <img name='pic' id="pic" src="__ROOT__{$info['QR_code']}" style="width:120px;padding-top:10px;">
                                        </div>
                                    </div>
                                </div>
                                <div class="space-4"></div>

                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right"> 所在地区 <span class="required">*</span> </label>
                                    <div class="col-sm-9">
                                        <select name="province" class="rcol-xs-10 col-sm-1" id="province">
                                            <volist name="province" id="pr">
                                                <option value="{$pr.id}" <if condition="$info['province'] eq $pr['id']">selected</if>>{$pr.name}</option>
                                            </volist>
                                        </select>
                                        <select name="city" class="rcol-xs-10 col-sm-1" id="city">
                                            <volist name="city" id="ci">
                                                <option value="{$ci.id}" <if condition="$info['city'] eq $ci['id']">selected</if>>{$ci.name}</option>
                                            </volist>
                                        </select>
                                        <select name="county" class="rcol-xs-10 col-sm-1" id="county">
                                            <volist name="county" id="co">
                                                <option value="{$co.id}" <if condition="$info['county'] eq $co['id']">selected</if>>{$co.name}</option>
                                            </volist>
                                        </select>
                                    </div>
                                </div>

                                <div class="space-4"></div>

                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right"> 详细地址<span class="required">*</span></label>
                                    <div class="col-sm-9">
                                        <input type="text" name="address" value="{$info['address']}" placeholder="详细地址" class="col-xs-10 col-sm-5">
                                    </div>
                                </div>
                                <div class="space-4"></div>
                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right">营业时间</label>
                                    <div class="col-sm-9">
                                        <input type="text" name="open_time" value="{$info['open_time']}" placeholder="营业时间" class="col-xs-10 col-sm-5">
                                    </div>
                                </div>
                                <div class="space-4"></div>

                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right"> 地图选址 </label>
                                    <div class="col-sm-6">
                                        <script src="__PUBLIC__/ueditor/ueditor.config.js" type="text/javascript"></script>
                                        <script src="__PUBLIC__/ueditor/ueditor.all.js" type="text/javascript"></script>
                                        <textarea name="desc" rows="100%" style="width:100%" id="myEditor">{$info['desc']}</textarea>
                                        <script type="text/javascript">
                                            var editor = new UE.ui.Editor();
                                            editor.render("myEditor");
                                        </script>
                                    </div>
                                </div>
                                <div class="col-md-offset-2 col-md-9">
                                    <button class="btn btn-info" type="submit">
                                        <i class="icon-ok bigger-110"></i>
                                        提交
                                    </button>

                                    &nbsp; &nbsp; &nbsp;
                                    <button class="btn btn-info" type="button" onclick='fan();'>
                                        <i class="icon-ok bigger-110"></i>
                                        返回
                                    </button>
                                </div>
                            </div>
                        </form>
                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <include file="Public/footer" />

</div><!-- /.main-container -->

<include file="Public/footerjs" />
<!-- inline scripts related to this page -->
<script type="text/javascript">
    function fan(){
        var urls = "{:U('AdminUser/index')}";
        window.location.href=urls;
    }
</script>
<script>
    $('#province').change(function () {
        var province_id = $('#province').val();
        $.ajax({
            url:"{:U('region')}",
            data:{'pid':province_id},
            type:'post',
            success:function (e) {
                var da = JSON.parse(e);
                var paty = '';
                for(var i=0;i<da.length;i++){
                    paty +='<option value="'+da[i].id+'">'+da[i].name+'</option>';
                }
                $('#city').html(paty);
            }
        })
    })
    $('#city').change(function () {
        var city_id = $('#city').val();
        $.ajax({
            url:"{:U('region')}",
            data:{'pid':city_id},
            type:'post',
            success:function (e) {
                var da = JSON.parse(e);
                var paty = '';
                for(var i=0;i<da.length;i++){
                    paty +='<option value="'+da[i].id+'">'+da[i].name+'</option>';
                }
                $('#county').html(paty);
            }
        })
    })
</script>
</body>
</html>
